package edu.spec.wyn.week09.class2.homework2;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class FootballTeam {
    public static void main(String[] args) {
        List team=new ArrayList();
        team.add("俄罗斯");team.add("沙特");team.add("埃及");team.add("乌拉圭");

        team.add("葡萄牙");team.add("西班牙");team.add("摩洛哥");team.add("伊朗");

        team.add("法国");team.add("澳大利亚");team.add("秘鲁");team.add("丹麦");

        team.add("阿根廷");team.add("冰岛");team.add("克罗地亚");team.add("尼日利亚");

        team.add("巴西");team.add("瑞士");team.add("哥斯达黎加");team.add("塞尔维亚");

        team.add("德国");team.add("墨西哥");team.add("瑞典");team.add("韩国");

        team.add("比利时");team.add("巴拿马");team.add("突尼斯");team.add("英格兰");

        team.add("波兰");team.add("塞内加尔");team.add("哥伦比亚");team.add("日本");


        Random rand = new Random();//随机数
        for(int i=1;i<=8;i++){
            System.out.println("第"+i+"组");
            for(int j = 0;j<4;j++)//四个球队为一组
            {
                String a = (String) team.get(rand.nextInt(team.size()));
                System.out.print("   "+a);
                team.remove(a);//将输出过的球队删除
            }
            System.out.println("\n");
        }
    }
}
